/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package clinsoftbeta.GUI;

import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
/**
 *
 * @author Sidiq Prihatno
 */
public class CumaHuruf extends PlainDocument {

    private String angka = "1234567890";
    @Override
    public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
//        super.insertString(offs, str, a);

        if (angka.indexOf(str) == -1) {
            super.insertString(offs, str, a);
        }
//        if (angka.indexOf(str) > -1) {
//            super.insertString(offs, str, a);
//        }
    }
}
